﻿@using KL.Store.Core;
@using CaptchaMvc.HtmlHelpers;
@{
    Layout = "~/Views/Shared/_LayoutBasic.cshtml";
    ViewBag.Title = "Edit";
    //Html.EnableClientValidation(false);
    var ToEdit = ViewBag.ToEdit;
}
<div id="processResult"></div>
<h2 style="display: inline-block;">Kategori Yönetimi</h2>
@{Html.RenderAction("EditMenu", "CategoryManage", new { id = ViewBag.id, toEdit = ToEdit });}
<br />
@if (ToEdit != "AddNewProduct")
{
    <div class="right">@(ViewBag.id) - @(ViewBag.CategoryName)</div>
}
<hr />
@if (ToEdit == "EditInfo")
{
    Html.RenderAction("EditInfo", "CategoryManage", new { id = ViewBag.id });
}
else if (ToEdit == "EditImages")
{
    Html.RenderAction("EditImages", "CategoryManage", new { id = ViewBag.id });
}
else if (ToEdit == "EditGroups")
{
    Html.RenderAction("EditGroups", "CategoryManage", new { id = ViewBag.id });
}
else if (ToEdit == "EditProperties")
{
    Html.RenderAction("EditProperties", "CategoryManage", new { id = ViewBag.id });
}
else if (ToEdit == "EditVariant")
{
    Html.RenderAction("EditVariant", "CategoryManage", new { id = ViewBag.id });
}
else if (ToEdit == "EditMeta")
{
    Html.RenderAction("EditMeta", "CategoryManage", new { id = ViewBag.id });
}
else if (ToEdit == "AddNewProduct")
{
    Html.RenderAction("AddNewProduct", "CategoryManage", new { id = ViewBag.id });
}

<script>

    function loadingMsg()
    {
        $('#processResult').show(0).html('<div class="bg-info"><p><i class="fa fa-spinner fa-spin"></i>&nbsp;Lütfen bekleyin.</p></div>');
    }
    function hideMsg()
    {
        $('#processResult').hide(0).html('');
    }
    function urunKaydedildi(yenileme)
    {
        $('#processResult').show(0).html('<div class="bg-info"><p><i class="fa fa-info-circle"></i>&nbsp;Bilgiler Kaydedildi</p></div>').delay(5000).hide(0);
        if ($.browser.webkit)
        {
            $('body:not(:animated)').animate({ scrollTop: 0 }, 'slow');
        }
        else
        {
            $('html:not(:animated)').animate({ scrollTop: 0 }, 'slow');
        }
        if (yenileme == '1')
        {
            parent.$.fancybox.close();
            parent.location.reload(true);
        }
    }
    function hataMesaji(mesaj)
    {
        $('#processResult').show(0).html('<div class="bg-danger"><p><i class="fa fa-info-circle"></i>&nbsp;' + mesaj + '.</p></div>');
        if ($.browser.webkit)
        {
            $('body:not(:animated)').animate({ scrollTop: 0 }, 'slow');
        }
        else
        {
            $('html:not(:animated)').animate({ scrollTop: 0 }, 'slow');
        }
    }
    $('#closeForm').click(function ()
    {
        parent.$.fancybox.close();
    });
    $('#productedit').bind("keyup keypress", function (e)
    {
        var code = e.keyCode || e.which;
        if (code == 13)
        {
            e.preventDefault();
            return false;
        }
    });
    $('#processResult').click(function ()
    {
        $(this).fadeOut('slow').html('');
    });
</script>
